package cn.tedu.autoshow.commons.util;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Random;

public class OrderNumberGenerator {
    public static String generateOrderDateNumber(LocalDateTime localDateTime) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");
        String timestamp = localDateTime.format(formatter);

        // 可根据实际需求定义其他规则，比如从数据库获取递增的序列号
        // ...
        Random random = new Random();
        int n = random.nextInt(900)+100;
        String orderNumber = "ORD-" + timestamp + n; // 示例中使用时间戳作为订单编号

        return orderNumber;
    }

}
